//
//  NJUSTBaseController.m
//  NJUSTHelper
//
//  Created by 郑越辉 on 2017/9/12.
//  Copyright © 2017年 njust. All rights reserved.
//

#import "NJUSTBaseController.h"
#import "LoginVC.h"
#import "NJUSTNavigationController.h"
#import "UserDBService.h"
@interface NJUSTBaseController ()

@end

@implementation NJUSTBaseController

- (void)viewDidLoad {
    [super viewDidLoad];
    //ios7 设置从导航栏下面开始算坐标起点
    if (IOS7) {
        //方法1：
        self.edgesForExtendedLayout = UIRectEdgeNone;
        self.extendedLayoutIncludesOpaqueBars = NO;
        self.modalPresentationCapturesStatusBarAppearance = NO;
        //方法2：
        self.navigationController.navigationBar.translucent = NO;  //导航栏不透明
    }
    self.view.backgroundColor = RandomColor;
    
    
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    
}

#pragma mark 弹窗登录界面

-(void)presentLoginVCAction
{
    LoginVC *vc = [[LoginVC alloc]initWithNibName:@"LoginVC" bundle:nil];
    
    NJUSTNavigationController *nav = [[NJUSTNavigationController alloc]initWithRootViewController:vc];
    
    [self presentViewController:nav animated:NO completion:nil];
    
//    [self.navigationController pushViewController:vc animated:YES];
}
-(void)logoutAction{
    
    AccountInfo.isLogin = NO;
    AccountInfo.userId = @"";
    AccountInfo.password = @"";
    AccountInfo.userName = @"";
    AccountInfo.libraryPwd = @"";
    AccountInfo.userCode = @"";
    [UserDBService logoutAllUser];
}

@end
